<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
    <title>蓝票列表</title>
</head>
<body>
<div th:fragment="tableBlock" class="widget-content nopaddingLR module-block">
    <div class="table-responsive">
        <table id="datatable" class="table table-striped data-table table-bordered" width="100%">
        <thead>
        <tr>
            <th class="table-head" id="businessType">业务类型</th>
            <th class="table-head" id="estatename">小区名称</th>
            <th class="table-head" id="invoiceTotalPriceTax">开票金额</th>
            <th class="table-head" id="invoiceStartTime">开票日期</th>
            <th class="table-head" id="invoiceCode">发票代码 </th>
            <th class="table-head" id="invoiceNo">发票号码</th>
            <th class="table-head" id="invoiceStatus">开票状态</th>
            <th class="table-head" id="redFlg">是否红冲</th>
            <th class="table-head" id="invoicePrintFlg">是否打印</th>
            <th class="table-head" id="invlidFlg">是否作废</th>
            <th class="table-head">操作</th>
        </tr>
        </thead>

        <tbody>
        <tr  th:each="invoice : ${formBean.list}">
            <td class="table-content" >
                <p th:each="codeName:${formBean.businessTypeList}" th:if="${codeName.code} == ${invoice.businessType}" th:text="${codeName.name}"/>
            </td>
            <td class="table-content" >
                <p th:each="estate:${formBean.estateList}" th:if="${estate.sfGuid} == ${invoice.estateSfGuid}" th:text="${estate.estateName}"/>
            </td>
            <td class="table-content" th:text="${invoice.invoiceTotalPriceTax}/100"></td>
            <td class="table-content" th:text="${invoice.invoiceStartTime}"></td>
            <td class="table-content" th:text="${invoice.invoiceCode}"></td>
            <td class="table-content" th:text="${invoice.invoiceNo}"></td>
            <td class="table-content" >
                <p th:each="codeName:${formBean.invoiceStatusList}" th:if="${codeName.code} == ${invoice.invoiceStatus}" th:text="${codeName.name}"/>
            </td>
            <td  class="table-content" th:switch="${invoice.redFlg}">
                <span th:case="1">无</span>
                <span th:case="0">有</span>
            </td>
            <td class="table-content" th:switch="${invoice.invoicePrintFlg}">
                <span th:case="0">无</span>
                <span th:case="1">有</span>
            </td>
            <td class="table-content" th:switch="${invoice.invlidFlg}">
                <span th:case="1">无</span>
                <span th:case="1">有</span>
            </td>
            <td>
                <div class="td-operate">
                    <a href="#" th:if="${invoice.invoiceStatus=='0'}" th:onclick="'javascript:invoiceVeiwSubmit(\''+${invoice.guid}+'\',\''+${invoice.invoiceType}+'\');'"  class="td-info">预览</a>
                    <a href="#" th:if="${invoice.invoiceStatus=='1'}" th:onclick="'javascript:invoiceVeiwSubmit(\''+${invoice.guid}+'\',\'blue\');'"  class="td-info">开票</a>
                    <a href="#" th:onclick="'javascript:detailSubmitInfo(\'blueInvoices\',\''+${invoice.guid}+'\');'" class="td-info">详情</a>
                </div>
            </td>
        </tr>

        </tbody>

    </table>
    </div>
</div>

</body>
</html>